package com.ruoyi.system.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Code {
    public static  String getCode(String billCode, int orderbill ) {
        if (orderbill < 1) {
            billCode = billCode + "0001";
        } else if (orderbill < 10) {
            billCode = billCode + "000" + orderbill;
        } else if (orderbill < 100) {
            billCode = billCode + "00" + orderbill;
        } else if (orderbill < 1000) {
            billCode = billCode + "0" + orderbill;
        } else {
            billCode = billCode + orderbill;
        }
        return billCode;
    }
    public static String getNowDate(){
        SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date(System.currentTimeMillis());
        String str=formatter.format(date);
        return str;
    }
}
